//
//  MineNotifyCell.m
//  Tunnel
//
//  Created by wbb on 2025/6/5.
//

#import "MineNotifyCell.h"
@implementation MineNotifyModel

@end

@interface MineNotifyCell ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView * arrowImageView;
@end
@implementation MineNotifyCell


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self) {
        self.backgroundColor = [UIColor clearColor];
        [self initUI];
    }
    return  self;
}
- (void)initUI {
    
    // 创建标题标签
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.titleLabel.textColor = main_text_color;
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.centerY.mas_equalTo(0);
    }];
    
    
    self.arrowImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
    self.arrowImageView.image = [UIImage imageNamed:@"mine_no_select"];
    self.arrowImageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:self.arrowImageView];
    [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10);
        make.centerY.mas_equalTo(0);
    }];
}

- (void)setCornerForIndexPath:(NSIndexPath *)indexPath totalRows:(NSInteger)totalRows dataSource:(NSArray *)dataArray {
    [super setCornerForIndexPath:indexPath  totalRows:totalRows];

    MineNotifyModel *model = dataArray[indexPath.row];
    self.titleLabel.text = model.title;
    
    self.arrowImageView.image = [UIImage imageNamed:model.isSelect?@"mine_select":@"mine_no_select"] ;

}

@end
